<!--
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<div id="topStatusBar" class="top-bar">
    <ul class="breadcrumb pull-left" style="display: inline; background-color: transparent;margin:0px;padding-top:0px;padding-bottom:0px;padding-left:4px;">
        <li>
            <a href="#alerts">
                All Alerts
            </a>
        </li>
        <li class="active">
            <%-alert.alertId ? alert.alertId : "New Alert"%>
        </li>
    </ul>
    <div class="job-detail-actions pull-right">
        <button id="deleteAlertButton" class="btn btn-default btn-small btn-red">
            Delete
        </button>
        <button id="saveAlertButton" class="btn btn-default btn-small" style="margin-left:8px;">
            Save
        </button>
    </div>
</div>
<div id="detailContainer" class="main-container">
    <div class="form" role="form">
        <div class="form-group">
            <label class="sr-only" for="alertType" style="margin-bottom:0px;">Type</label>
            <select id="alertType" class="form-control">
                <%_.each(alertTypes,function(val, key){%>
                    <option value="<%-key%>"><%-val%></option>
                <%})%>
            </select>
        </div>
    </div>
    <div id="alertTimeout" class="form" role="form">
        <div class="form-group">
            <label class="sr-only" for="timeout" style="margin-bottom:0px;">Timeout (minutes)</label>
            <input value="<%-alert.timeout%>" type="text" class="form-control" id="timeout" name="timeout" placeholder="">
        </div>
    </div>
    <div class="form" role="form">
        <div class="form-group">
            <label class="sr-only" for="email" style="margin-bottom:0px;">Emails (comma-separated)</label>
            <input value="<%-alert.email%>" type="text" class="form-control" id="email" name="email" placeholder="">
        </div>
    </div>
    <div class="form" role="form">
        <div class="form-group">
            <label class="sr-only" for="webhookURL" style="margin-bottom:0px;">Webhook URL</label>
            <input value="<%-alert.webhookURL%>" type="text" class="form-control" id="email" name="webhookURL"
                   placeholder="">
        </div>
    </div>
    <div class="form" role="form">
        <div class="form-group">
            <label class="sr-only" for="jobIds" style="margin-bottom:0px;">Job Ids or Aliases (comma-separated)</label>
            <input value="<%-alert.jobIds%>" type="text" class="form-control" id="jobIds" name="jobIds" placeholder="">
        </div>
    </div>
    <div class="form" role="form">
        <div class="form-group">
            <label class="sr-only" for="delay" style="margin-bottom:0px;">Delay (minutes)</label>
            <input value="<%-alert.delay%>" type="text" class="form-control" id="delay" name="delay" placeholder="">
        </div>
    </div>
    <div id="alertCanaryPathConfig" class="form" roles="form">
        <div class="form-group">
            <label class="sr-only" for="canaryPath" style="margin-bottom:0px;">Path</label><div id="canaryPathHint"></div>
            <input value="<%-alert.canaryPath%>" type="text" class="form-control" id="canaryPath" name="canaryPath" placeholder="">
        </div>
    </div>
    <div id="alertCanaryConfig" class="form" roles="form">
        <div class="form-group">
            <label class="sr-only" for="canaryConfigThreshold" style="margin-bottom:0px;">Threshold (alert if below this value)</label>
            <input value="<%-alert.canaryConfigThreshold%>" type="text" class="form-control" id="canaryConfigThreshold" name="canaryConfigThreshold" placeholder="">
        </div>
    </div>
    <div id="alertCanaryFilterConfig" class="form" roles="form">
        <div class="form-group">
            <label class="sr-only" for="canaryOps" style="margin-bottom:0px;">Ops</label>
            <input value="<%-alert.canaryOps%>" type="text" class="form-control" id="canaryOps" name="canaryOps" placeholder="">
        </div>
        <div class="form-group">
            <label class="sr-only" for="canaryRops" style="margin-bottom:0px;">Rops</label>
            <input value="<%-alert.canaryRops%>" type="text" class="form-control" id="canaryRops" name="canaryRops" placeholder="">
        </div>
        <div class="form-group">
            <label class="sr-only" for="canaryFilter" style="margin-bottom:0px;">Filter</label>
            <input value="<%-alert.canaryFilter%>" type="text" class="form-control" id="canaryFilter" name="canaryFilter" placeholder="">
        </div>
    </div>
    <div id="alertSigmaConfig" class="form" roles="form">
        <div class="form-group">
            <label class="sr-only" for="sigma" style="margin-bottom:0px;">Sigma</label>
            <input value="<%-alert.sigma%>" type="text" class="form-control" id="sigma" name="sigma" placeholder="">
        </div>
        <div class="form-group">
            <label class="sr-only" for="tolerance" style="margin-bottom:0px;">Tolerance</label>
            <input value="<%-alert.tolerance%>" type="text" class="form-control" id="tolerance" name="tolerance" placeholder="">
        </div>
    </div>
    <div class="form" role="form">
        <label class="sr-only" for="suppressChanges" style="margin-bottom:0px;">Suppress Changes</label>
        <input value="<%-alert.suppressChanges%>" type="text" class="form-control" id="suppressChanges" name="suppressChanges" placeholder="">
    </div>
    <div id="alertDescription" class="form" role="form">
        <div class="form-group">
            <label class="sr-only" for="timeout" style="margin-bottom:0px;">Alert description</label>
            <textarea rows="4" cols="50" class="form-control" id="description" name="description" placeholder=""><%-alert.description%></textarea>
        </div>
    </div>
    <div id="activeAlerts" class="form" role="form">
        <div class="form-group">
            <label class="sr-only" for="timeout" style="margin-bottom:0px;">Active alerts</label>
            <textarea readonly rows="4" cols="50" class="form-control" id="active" name="active" placeholder=""><%-JSON.stringify(alert.activeJobs, null, '\t')%></textarea>
        </div>
    </div>
</div>
<div id="alertDetailContainer" class="main-container">
</div>
